package ch.areion.areionapp.sensor;
import ch.areion.areionapp.core.Disconnectable;

import ioio.lib.api.exception.ConnectionLostException;

public interface IIRSensor extends Disconnectable {
	public enum IRS {
		FRONTLEFT,
		FRONTRIGHT,
		SIDE;
	}
	
	/**
	 * Waits until the pins has the given value;
	 * @param irs The sensor to check.
	 * @param value The value, waiting for.
	 */
	void waitUntil(IRS irs, boolean value) throws InterruptedException, ConnectionLostException;
	
	/**
	 * Reads the actual value of a given sensor.
	 * @param irs The given sensor.
	 * @return True if has contact, false if not.
	 */
	boolean read(IRS irs) throws InterruptedException, ConnectionLostException;
}
